Manages the depth and stencil states available in the component. More...
Public Member Functions | |
| ~DepthStencilStateManager () | |
| DepthStencilState * | createOrRetrieve (const nkMemory::StringView &name) |
| DepthStencilState * | get (const nkMemory::StringView &name) |
| DepthStencilState * | getByIndex (unsigned int index) |
| void | rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName) |
| void | erase (const nkMemory::StringView &name) |
| DepthStencilState * | getDefaultState () const |
Manages the depth and stencil states available in the component.
The manager owns the memory it allocates. External code should never free memory returned.
| nkGraphics::DepthStencilStateManager::~DepthStencilStateManager | ( | ) |
Destructor.
| DepthStencilState* nkGraphics::DepthStencilStateManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, a state.
| name | The name of the state to retrieve. |
| DepthStencilState* nkGraphics::DepthStencilStateManager::get | ( | const nkMemory::StringView & | name | ) |
Retrieves a state.
| name | The name of the state to retrieve. |
| DepthStencilState* nkGraphics::DepthStencilStateManager::getByIndex | ( | unsigned int | index | ) |
Retrieves a state by index. Note that an index can map to different states as the internal memory is changed. Mainly used for looping over all states in one go.
| index | The index of the state to retrieve. |
| void nkGraphics::DepthStencilStateManager::rename | ( | const nkMemory::StringView & | oldName, |
| const nkMemory::StringView & | newName | ||
| ) |
Renames a state, changing both its name and the way to address it in the manager.
| oldName | The name of the state to rename. |
| newName | The new name to attach to it. |
| void nkGraphics::DepthStencilStateManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees the memory allocated for a state.
| name | The name of the state to erase. |
| DepthStencilState* nkGraphics::DepthStencilStateManager::getDefaultState | ( | ) | const |